package cn.iocoder.yudao.module.handguard.controller.app.userbasetable11;

import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;

import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;

import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;

import cn.iocoder.yudao.module.handguard.controller.app.userbasetable11.vo.*;
import cn.iocoder.yudao.module.handguard.dal.dataobject.userbasetable11.UserBaseTable11DO;
import cn.iocoder.yudao.module.handguard.convert.userbasetable11.UserBaseTable11Convert;
import cn.iocoder.yudao.module.handguard.service.userbasetable11.UserBaseTable11Service;

@Tag(name = "小程序 - 税贷")
@RestController
@RequestMapping("/hutai/user-base-table11")
@Validated
public class UserBaseTable11Controller {

    @Resource
    private UserBaseTable11Service userBaseTable11Service;

    @PostMapping("/create")
    @Operation(summary = "创建税贷")
    public CommonResult<Long> createUserBaseTable11(@Valid @RequestBody UserBaseTable11CreateReqVO createReqVO) {
        return success(userBaseTable11Service.createUserBaseTable11(createReqVO));
    }

    @PutMapping("/update")
    @Operation(summary = "更新税贷")
    public CommonResult<Boolean> updateUserBaseTable11(@Valid @RequestBody UserBaseTable11UpdateReqVO updateReqVO) {
        userBaseTable11Service.updateUserBaseTable11(updateReqVO);
        return success(true);
    }

    @GetMapping("/get")
    @Operation(summary = "获得税贷")
    public CommonResult<UserBaseTable11RespVO> getUserBaseTable11(Long ui) {
        UserBaseTable11DO userBaseTable11 = userBaseTable11Service.getUserBaseTable11(ui);
        return success(UserBaseTable11Convert.INSTANCE.convert(userBaseTable11));
    }


}
